// JavaScript Document

$(function() {
	
	$("#mainArticle").width($("body").width());

	if ($(window).height() >= 1000) {
		$("#headerImg").attr("src", "../image/header.jpg").height(330);
		$("#header").height(368);
	} else if ($(window).height() >= 800) {
		$("#headerImg").attr("src", "../image/header2.jpg").height(250);
		$("#header").height(288);
	} else {
		$("#headerImg").attr("src", "").height(0);
		$("#header").height(38);
		var height = $("#mainArticle").height();
		if (height < $(window).height())
			$("#mainArticle").css(
					"top",
					($(window).height() - height) / 2 + $(window).scrollTop()
							+ "px");
		else
			$("#mainArticle").css("top", "0px");
	}
	var width = ($("body").width() - 1124) / 2;
	if (width <= 0)
		width = 0;
	$(".content").css("left", width + "px");
	$(".header").css("left", width + "px");
	$(".footer").css("left", width + "px");
	$(".footer2").css("left", width + "px");
	//alert($(window).height());

	/*if($.browser.mozilla){
	     var width = $("mainArticle").width();
	     $("mainArticle").width(width-20);
	}
	 */
	//else
	//$(".header img").hide();
});

$(window).resize(
		function() {
			$("#mainArticle").width($("body").width());
			if ($(window).height() >= 1000) {
				$("#headerImg").attr("src", "../image/header.jpg").height(330);
				$("#header").height(368);
			} else if ($(window).height() >= 800) {
				$("#headerImg").attr("src", "../image/header2.jpg").height(250);
				$("#header").height(288);
			} else {
				$("#headerImg").attr("src", "").height(0);
				$("#header").height(38);
				var height = $("#mainArticle").height();
				if (height < $(window).height())
					$("#mainArticle").css(
							"top",
							($(window).height() - height) / 2
									+ $(window).scrollTop() + "px");
				else
					$("#mainArticle").css("top", "0px");
			}
			var width = ($("body").width() - 1124) / 2;
			if (width <= 0)
				width = 0;
			$(".content").css("left", width + "px");
			$(".header").css("left", width + "px");
			$(".footer").css("left", width + "px");
			$(".footer2").css("left", width + "px");
		});
/*
 jQuery.fn.center = function () {
 this.css("position","absolute");
 this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
 this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
 return this;
 }

 $(function(){
 $("#mainArticle").center();
 })
 */
function loginOut(){
	location.href='login.jsp?flag=exit';
}
function logoutMeeting(){
	location.href='index_meeting2.jsp?flag=exit';
}
function meeting_loginOut(){
	location.href='login_meeting.jsp?flag=exit';
}
function create(x) {
	$("#targetFrame").css("background", "#fff");
	if (x == "map") {
		$("#targetFrame").attr("src", "map-simple-google.html");
	} else if (x == "SB") {
		$("#targetFrame").attr("src", 'listSB.jsp');
	} else if (x == "WP") {
		$("#targetFrame").attr("src", 'listWP.jsp');
	} else if (x == "WPCK") {
		$("#targetFrame").attr("src", 'WP_Storage.jsp');
	} else if (x == "route") {
		$("#targetFrame").attr("src", 'route1.jsp');
	} else if (x == "CLCX") {
		$("#targetFrame").attr("src", 'list_CLCX.jsp');
	} else if (x == "CLSQ") {
		$("#targetFrame").attr("src", 'list_CLSQ.jsp');
	} else if (x == "CLHC") {
		$("#targetFrame").attr("src", 'list_CLHC.jsp');
	} else if (x == "SBBJ") {
		$("#targetFrame").attr("src", 'SB_BJ.jsp');
	} else if (x == "CLBJ") {
		$("#targetFrame").attr("src", 'CL_BJ.jsp');
	} else if (x == "user") {
		$("#targetFrame").attr("src", 'User.jsp');
	} else if (x == "userMes") {
		$("#targetFrame").attr("src", 'UserMes.jsp');
	} else if (x == "userPas") {
		$("#targetFrame").attr("src", 'UserPas.jsp');
	} else if (x == "HYCX") {
		$("#targetFrame").attr("src", 'RL.jsp');
	} else if (x == "HYYY") {
		$("#targetFrame").attr("src", 'meetBooking.jsp');
	} else if (x == "HYGL") {
		$("#targetFrame").attr("src", 'meetingRoom.jsp');
	} else if (x == "HYCX2") {
		$("#targetFrame").attr("src", 'RL2.jsp');
	}
};
